package com.gaoxinfu.demo.jackson.entity;

import com.fasterxml.jackson.annotation.JsonIdentityReference;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;

/**
 * @Description:
 * @Author: gaoxinfu
 * @Date: 2021-01-08 17:44
 */
@Entity
public class Human extends Carrier{
    @Id
    private String id;

    @JsonIdentityReference(alwaysAsId = true) //(1)
    @OneToOne
    private Head head;

    private String hand;
}
